//
//  XJSureOrderCell.m
//  XinJiangMall
//
//  Created by RaoBo on 2018/6/12.
//  Copyright © 2018年 Tzyang. All rights reserved.
//

#import "XJSureOrderCell.h"

#import "XJSureOrderGoodsModel.h"

@interface XJSureOrderCell()
@property (weak, nonatomic) IBOutlet UIImageView *imgIv;
@property (weak, nonatomic) IBOutlet UILabel *descLb; // 商铺描述

@property (weak, nonatomic) IBOutlet UILabel *guigeLb; //规格
@property (weak, nonatomic) IBOutlet UILabel *priceLb; //价格

@property (weak, nonatomic) IBOutlet UILabel *cntLb; // 数量 x1


@end

@implementation XJSureOrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.imgIv.layer.masksToBounds = YES;
    self.imgIv.layer.cornerRadius = 5;
    
    self.guigeLb.hidden = YES;// 6-12 服务器没有返回该字段 先隐藏。
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

#pragma mark - setter方法
- (void)setGoodsModel:(XJSureOrderGoodsModel *)goodsModel {
    _goodsModel = goodsModel;
    
    UIImage *placeholderImg = [UIImage imageNamed:@"default_goods"];
    
    [self.imgIv sd_setImageWithURL:[NSURL URLWithString:goodsModel.cover] placeholderImage:placeholderImg];
    self.descLb.text = goodsModel.name;
    
//    self.guigeLb.text = goodsModel.
    
    self.priceLb.text = [NSString stringWithFormat:@"￥%.2f",[goodsModel.price floatValue]];
    
    self.cntLb.text = [NSString stringWithFormat:@"x%@",goodsModel.quantity];
}


@end
